﻿
Partial Class CustomControls_EncabezadoDatosHogar
    Inherits System.Web.UI.UserControl
    Private _idhogar As String
    Public Property idhogar() As String
        Get
            Return _idhogar
        End Get
        Set(ByVal value As String)
            _idhogar = value
        End Set
    End Property
    Private _idVisita As String
    Public Property idVisita() As String
        Get
            Return _idVisita
        End Get
        Set(ByVal value As String)
            _idVisita = value
        End Set
    End Property
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            cargarDAtos()
        End If
    End Sub
    Sub cargarDatos()
        Using bd As New BdHogaresDataContext
            Dim v As New Web_Visita
            Dim a = (From i In bd.Web_Visitas
            Where (i.idvisita = _idVisita)
                   Select i).FirstOrDefault

            lblVisita.Text = a.Visita
            lblFVisita.Text = CDate(a.FechaDiligenciamiento).ToShortDateString

            Dim b = (From h In bd.Web_FormularioIdentificacionHogars
                     Where h.idHogar = _idhogar
                     Select h.CodCoba, h.Web_Proyecto.CodigoProyecto).FirstOrDefault

            lblCoba.Text = b.CodCoba
            lblProyecto.Text = b.CodigoProyecto


        End Using
    End Sub
End Class
